<template>
	<view class="box">
		<!-- 岗位详情头部 -->
		<view>

			<view class="mylis">
				<view class="top">
					<view class="tit">
						{{ job.title || ''}}
					</view>

					<view class="month"> 联系人：{{ job.publishName || ''}} </view>
				</view>
				<view class="bot">
				 <view v-if="job.monthlySalaryMin || job.monthlySalaryMax" class="tags">
            {{ job.monthlySalaryMin || ''}}
           {{job.monthlySalaryMax==null?"元/月+":"~"+job.monthlySalaryMax+"元/月"}}
		    {{job.royalty =='true'?'+提成':''}}

          </view>
            <view v-else class="tags">
             薪资面议
			 {{job.royalty =='true'?'+提成':''}}
          </view>
					<view class="hours">
<!--						<view class="day"> 工价 </view>-->
						<view class="moneys" style="margin-right: 10px">{{ phone || ''}}</view>
            <u-button shape="square" size="mini"  type="primary" @click="call(job.publishTell)">拨打</u-button>

          </view>
				</view>
<!--				<view class="tags">-->
<!--					<u-tag :key="index" v-for="(item, index) in labels" class="li" :text="item" plain size="mini"-->
<!--						type="primary"></u-tag>-->
<!--				</view>-->
<!--        {{ job }}-->
<!--				<view class="company">-->
<!--					<view class="company-left">-->
<!--						<img :src="infor.logoUrl" />-->
<!--						{{ infor.name }}-->
<!--					</view>-->
<!--					<view class="company-right">-->
<!--						<u-icon name="map-fill" color="#ccc" size="28"></u-icon>-->
<!--						{{ infor.address }}-->
<!--					</view>-->
<!--				</view>-->
			</view>
		</view>
	</view>
</template>

<script>
	import api from '../../../../../api/routes.js'
	export default {
		props: ["infor", "job", 'labels','phone'],
    methods:{
    async call(tell){
		const res = await this.$myRequest({
		  	url: api.myJobCount,
		  	method: "GET",
		  	 data:{},
	    })
		console.log(res,'ressss');
		
		if(res.data.count>0){
			uni.makePhoneCall({
				phoneNumber: tell, //仅为示例
			});
		}else{
			wx.showToast({
				title: '您至少发布一条求职信息才可拨打电话',
				icon: 'none'
			})				
			setTimeout(() => {
				// wx.navigateTo(
				//    url:'/package/pages/release/jobWanted',
				// );
				uni.navigateTo({
					url: '/package/pages/release/jobWanted',
				});
				wx.hideLoading()
			}, 1500)
		}
		  

				// uni.makePhoneCall({
				// 	phoneNumber: tell, //仅为示例
				// });


        // window.location.href="tel:"+tell;
      }
    }
	};
</script>
<style>
	page {
		background: #f5f7f9;
	}
</style>
<style scoped lang="scss">
	.infor {
		padding-bottom: 70px;
	}

	.company {
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: 22rpx;
		margin: 10px 0 0;
		color: #999999;

		&-left {
			display: flex;
			align-items: center;
			font-family: PingFang SC;
			font-weight: bold;

			img {
				width: 25px;
				height: 25px;
				border-radius: 50%;
				margin: 0 5px 0 0;
			}
		}

		&-right {
			text-align: right;
			display: flex;
			align-items: center;
		}
	}

	.tags {
		margin: 5px 0;

		.li {
			margin-right: 12px;
		}
	}

	.detail {
		position: relative;
	}

	.indicatorBox {
		position: absolute;
		bottom: 30px;
		border-radius: 5px;
		background: rgba(235, 96, 59, 0.2);
		display: flex;
		align-items: center;
		left: 20%;
		right: 20%;
		overflow: hidden;

		.lis {
			text-align: center;
			flex: 1;
			line-height: 26px;
			font-size: 12px;
			color: #fff;
			border-color: rgba(255, 255, 255, 0.3);
			border-left: 1px solid rgba(255, 255, 255, 0.3);
		}

		.active {
			background-color: $my-primary;
		}
	}

	.mylis {
		background: #ffffff;
		padding: 32rpx 32rpx 28rpx;
		border-bottom: 1px solid #f7f8fa;

		&:last-child {
			margin-bottom: 0;
		}

		.top {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-bottom: 15rpx;

			.month {
				text-align: right;
				font-size: 14px;
				color: #999;
				flex: 1;
			}

			.tit {
				flex: 2;
				// line-height: 42rpx;
				// height: 84rpx;
				font-size: 18px;
				font-weight: bold;
				color: #333333;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical; /*设置对齐模式*/
				-webkit-line-clamp: 2; /*设置多行的行数，示例为2行*/
				
				// text-overflow: -o-ellipsis-lastline;
				// overflow: hidden;
				// text-overflow: ellipsis;
				// display: -webkit-box;
				// -webkit-line-clamp: 1;
				// line-clamp: 1;
				// -webkit-box-orient: vertical;
			}
		}

		.bot {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.hours {
				display: flex;
				align-items: center;

				.day {
					text-align: center;
					width: 80rpx;
					font-size: 12px;
					border-radius: 0 10px 0 10px;
					color: #fff;
					// padding: 0 12px;
					line-height: 22px;
					background: -webkit-linear-gradient(90deg, $my-primary, $my-jb);
					/* Safari 5.1 - 6.0 */
					background: -o-linear-gradient(90deg, $my-primary, $my-jb);
					/* Opera 11.1 - 12.0 */
					background: -moz-linear-gradient(90deg, $my-primary, $my-jb);
					/* Firefox 3.6 - 15 */
					background: linear-gradient(90deg, $my-primary, $my-jb);
				}

				.moneys {
					color: $my-primary;
					font-size: 14px;
					margin-left: 10rpx;
				}
			}

			.tags {
				font-size: 16px;
				color: #fb6464;
			}
		}
	}
</style>
